/*
 * @Description: 
 * @Version: 
 * @Author: 学渣小宝
 * @Date: 2021-03-29 20:50:57
 * @LastEditors: 学渣小宝
 * @LastEditTime: 2021-03-31 21:04:17
 */
'use strict';

/** @type Egg.EggPlugin */
module.exports = {
  // had enabled by egg
  // static: {
  //   enable: true,
  // }
  nunjucks: {
    enable: true,
    package: 'egg-view-nunjucks',
  },
  handlebars: {
    enable: true,
    package: 'egg-view-handlebars',
  },
  ejs: {
    enable: true,
    package: 'egg-view-ejs',
  },
  mongoose: {
    enable: true,
    package: 'egg-mongoose',
  },
  mysql: {
    enable: true,
    package: 'egg-mysql',
  },
  sequelize: {
    enable: true,
    package: 'egg-sequelize',
  },
  // onerror: {
  //   accepts: () => 'json',
  // },
  onerror: {
    accepts: (ctx) => {
      if (ctx.get('content-type') === 'application/json') return 'json';
      return 'html';
    }
},
};


